//
//  NSTimer+TMAddition.m
//  供销宝
//
//  Created by 金晶 on 17/3/13.
//  Copyright © 2017年 金晶. All rights reserved.
//

#import "NSTimer+TMAddition.h"

@implementation NSTimer (TMAddition)

-(void)pauseTimer{
    
    if (![self isValid]) {
        return ;
    }
    
    [self setFireDate:[NSDate distantFuture]]; //如果给我一个期限，我希望是4001-01-01 00:00:00 +0000
}


-(void)resumeTimer{
    
    if (![self isValid]) {
        return ;
    }
    [self setFireDate:[NSDate date]];
}

- (void)resumeTimerAfterTimeInterval:(NSTimeInterval)interval
{
    if (![self isValid]) {
        return ;
    }
    [self setFireDate:[NSDate dateWithTimeIntervalSinceNow:interval]];
}

@end
